package com.zygh.lz.controller.pc;

import com.zygh.lz.service.impl.VehicleLocationService;
import com.zygh.lz.stapprove.ResultUtil;
import com.zygh.lz.vo.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "车辆定位")
@RestController
@RequestMapping("/VehicleLocationController")
public class VehicleLocationController {

    @Resource
    private VehicleLocationService vehicleLocationService;

    @ApiOperation("查询车辆实时定位")
    @GetMapping("findVehicleLocation")
    public ResultBean findVehicleLocation(String parameter) {
        return ResultUtil.setOK("success", vehicleLocationService.findVehicleLocation(parameter));
    }

    @ApiOperation("警情定位")
    @GetMapping("alertLocation")
    public ResultBean alertLocation(String parameter) {
        return ResultUtil.setOK("success", vehicleLocationService.alertLocation(parameter));
    }


    @ApiOperation("在线设备数")
    @GetMapping("onLineVehicleLocation")
    public ResultBean onLineVehicleLocation(Integer id) {
        return ResultUtil.setOK("success", vehicleLocationService.onLineVehicleLocation(id));
    }


    @ApiOperation("当日累计在线设备数")
    @GetMapping("onLineVehicles")
    public ResultBean onLineVehicles(Integer id) {
        return ResultUtil.setOK("success", vehicleLocationService.onLineVehicles(id));
    }




    @ApiOperation("在线民警辅警")
    @GetMapping("onLinePoliceStrength")
    public ResultBean onLinePoliceStrength(String parameter) {
        return ResultUtil.setOK("success", vehicleLocationService.onLinePoliceStrength(parameter));
    }


}
